<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">











<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>memos2 - User's guide</title>
    <style type="text/css" media="all">
      @import url("./css/maven-base.css");
      @import url("./css/maven-theme.css");
      @import url("./css/site.css");
    </style>
    <link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
          <meta name="author" content="Simone Tripodi" />
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
      </head>
  <body class="composite">
    <div id="banner">
                  <a href="" id="bannerLeft">
    
                                            <img src="images/logo.png" alt="" />
    
            </a>
                        <a href="http://www.asemantics.com/" id="bannerRight">
    
                                    <img src="http://www.asemantics.com/images/logo.gif" alt="" />
    
            </a>
            <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="breadcrumbs">
          
  

  
    
  
  
    
            <div class="xleft">
        Last Published: 2009-05-24
                          |   
          Version: 1.0-beta
                        </div>
            <div class="xright">            <a href="">Project Page</a>
            |
                <a href="downloads/list">Downloads</a>
            |
                <a href="http://fabrizio.zellini.org/oscache-memcached-memos" class="externalLink">memOS</a>
            |
                <a href="http://www.opensymphony.com/oscache/" class="externalLink">OSCache</a>
            |
                <a href="http://www.danga.com/memcached/" class="externalLink">Memcached</a>
            |
                <a href="../spymemcached/">Spy Memcached</a>
            
  

  
    
  
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
    <div id="leftColumn">
      <div id="navcolumn">
           
  

  
    
  
  
    
                   <h5>memOS2</h5>
            <ul>
              
    <li class="none">
                    <a href="index.html">Introduction</a>
          </li>
              
    <li class="none">
              <strong>User's Guide</strong>
        </li>
              
    <li class="none">
                    <a href="faq.html">FAQ</a>
          </li>
          </ul>
              <h5>Project Documentation</h5>
            <ul>
              
                
              
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="project-info.html">Project Information</a>
                </li>
              
                
              
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
            
      
              
        <li class="collapsed">
                    <a href="project-reports.html">Project Reports</a>
                </li>
          </ul>
                                           <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
            <img alt="Built by Maven" src="./images/logos/maven-feather.png"></img>
          </a>
                       
  

  
    
  
  
    
        </div>
    </div>
    <div id="bodyColumn">
      <div id="contentBox">
        <div class="section"><h2>Overview</h2>
<p>Ready to start? First of all, configure in your <tt>pom.xml</tt>
 the <tt>repository</tt>
:</p>
<div class="source"><pre>&lt;repositories&gt;
  ...
  &lt;repository&gt;
      &lt;id&gt;memos2-repository&lt;/id&gt;
      &lt;name&gt;memos2 Repository for Maven&lt;/name&gt;
      &lt;url&gt;http://memos2.googlecode.com/svn/repo&lt;/url&gt;
      &lt;layout&gt;default&lt;/layout&gt;
  &lt;/repository&gt;
  ...
&lt;/repositories&gt;</pre>
</div>
</div>
<div class="section"><h2>Using the Persistence Listener</h2>
<p>To enable it, just set the <tt>cache.persistence.class</tt>
 property in the classpath resource <tt>oscache.properties</tt>
 as:</p>
<div class="source"><pre>cache.persistence.class=com.asemantics.memos2.MemcachedListener</pre>
</div>
<p>Follow below supported properties users can add to <tt>oscache.properties</tt>
 classpath resource to configure the listener:</p>
<table class="bodyTable"><tbody><tr class="a"><td align="center"><b>property</b>
</td>
<td align="center"><b>description</b>
</td>
<td align="center"><b>default</b>
</td>
</tr>
<tr class="b"><td align="center">cache.memcached.servers</td>
<td align="center"><tt>${server}:${port}</tt>
 connection string list</td>
<td align="center">localhost:11211</td>
</tr>
<tr class="a"><td align="center">cache.memcached.connectionfactory</td>
<td align="center">The <tt>net.spy.memcached.ConnectionFactory</tt>
 class</td>
<td align="center">net.spy.memcached.DefaultConnectionFactory</td>
</tr>
<tr class="b"><td align="center">cache.memcached.keyprefix</td>
<td align="center">The key prefix, useful when memcached servers are<br />
shared between more than one client, to avoid keys<br />
collision.</td>
<td align="center">_oscache_</td>
</tr>
<tr class="a"><td align="center">cache.memcached.groupprefix</td>
<td align="center">Same for key, but to identify groups. A group is<br />
generally identifyied by concatenating keys<br />
<tt>cache.memcached.keyprefix</tt>
<br />
and <tt>cache.memcached.groupprefix</tt>
</td>
<td align="center">__group__</td>
</tr>
<tr class="b"><td align="center">cache.memcached.expiration</td>
<td align="center">The number of seconds entries will be stored</td>
<td align="center">the number of seconds in 30 days</td>
</tr>
<tr class="a"><td align="center">cache.memcached.asyncget</td>
<td align="center">Flag to denote if client uses sync/async get</td>
<td align="center">true</td>
</tr>
<tr class="b"><td align="center">cache.memcached.timeout</td>
<td align="center">Connection timeout for async operations (if set)</td>
<td align="center">5</td>
</tr>
<tr class="a"><td align="center">cache.memcached.timeoutunit</td>
<td align="center">The connection timeout unit for async operations</td>
<td align="center"><tt>SECONDS</tt>
, admitted values are:<br />
* <tt>MICROSECONDS</tt>
;<br />
* <tt>MILLISECONDS</tt>
;<br />
* <tt>NANOSECONDS</tt>
;<br />
* <tt>SECONDS</tt>
.</td>
</tr>
</tbody>
</table>
<p>That's all, the magic happens just invoking <tt>OSCache</tt>
 in your code!!!</p>
</div>

      </div>
    </div>
    <div class="clear">
      <hr/>
    </div>
    <div id="footer">
      <div class="xright">&#169;  
          2009
    
          Asemantics S.r.l.
          
  

  
    
  
  
    
  </div>
      <div class="clear">
        <hr/>
      </div>
    </div>
  </body>
</html>
